<template>
  <div>
    <!-- 年度开工率 -->
    <Echart
      :options="options"
      :id="'line'+Math.random()"
      :height="cdata.height"
      width="100%"
    ></Echart>
  </div>
</template>

<script>
import Echart from "@/common/echart";


export default {
  props:["cdata"],
  data() {
    return {
    option :{
  title: {
    text: 'World Population'
  },
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'shadow'
    }
  },
  legend: {},
  grid: {
    left: '3%',
    right: '4%',
    bottom: '3%',
    containLabel: true
  },
  xAxis: {
    type: 'value',
    boundaryGap: [0, 0.01]
  },
  yAxis: {
    type: 'category',
    data:cdata.category|| ['Brazil', 'Indonesia', 'USA', 'India', 'China', 'World']
  },
  series: [
    {
      name: '2011',
      type: 'bar',
      data:cdata?cdata.lineData[0]:[18203, 23489, 29034, 104970, 131744, 630230]
    },
    {
      name: '2012',
      type: 'bar',
      data:cdata?cdata.lineData[1]: [19325, 23438, 31000, 121594, 134141, 681807]
    }
  ]
}
    };
  },
  components: {
    Echart,
  },
 
  methods:{

  },
};
</script>